﻿namespace BloggerBackup
{
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class SelectPathOptionDialog : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("Cancel_Button")]
        private Button _Cancel_Button;
        [AccessedThroughProperty("ColumnHeader1")]
        private ColumnHeader _ColumnHeader1;
        [AccessedThroughProperty("ColumnHeader2")]
        private ColumnHeader _ColumnHeader2;
        [AccessedThroughProperty("ColumnHeader3")]
        private ColumnHeader _ColumnHeader3;
        [AccessedThroughProperty("CustomTextLinkLabel")]
        private LinkLabel _CustomTextLinkLabel;
        [AccessedThroughProperty("lvwOptions")]
        private ListView _lvwOptions;
        [AccessedThroughProperty("OK_Button")]
        private Button _OK_Button;
        [AccessedThroughProperty("TableLayoutPanel1")]
        private TableLayoutPanel _TableLayoutPanel1;
        private IContainer components;

        [DebuggerNonUserCode]
        public SelectPathOptionDialog()
        {
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.InitializeComponent();
        }

        private void Cancel_Button_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void CustomTextLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string str = Interaction.InputBox("Please enter the text you would like to include in the file name", "Enter Custom Text", "", -1, -1);
            if (str.Trim().Length != 0)
            {
                NameOption option = new NameOption();
                option.BaselineXMLTag = "customtext";
                option.FormatString = "";
                option.CustomText = str;
                option.Name = str;
                option.Description = "Custom, user entered static text";
                ListViewItem item = new ListViewItem();
                item.Text = option.Name;
                item.Tag = option;
                item.SubItems.Add(option.Description);
                item.SubItems.Add(option.FormatString);
                item.Checked = true;
                this.lvwOptions.Items.Add(item);
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (((disposing && (this.components != null)) ? 1 : 0) != 0)
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.TableLayoutPanel1 = new TableLayoutPanel();
            this.OK_Button = new Button();
            this.Cancel_Button = new Button();
            this.lvwOptions = new ListView();
            this.ColumnHeader1 = new ColumnHeader();
            this.ColumnHeader2 = new ColumnHeader();
            this.ColumnHeader3 = new ColumnHeader();
            this.CustomTextLinkLabel = new LinkLabel();
            this.TableLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            this.TableLayoutPanel1.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.TableLayoutPanel1.ColumnCount = 2;
            this.TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f));
            this.TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f));
            this.TableLayoutPanel1.Controls.Add(this.OK_Button, 0, 0);
            this.TableLayoutPanel1.Controls.Add(this.Cancel_Button, 1, 0);
            Point point = new Point(0x179, 0x112);
            this.TableLayoutPanel1.Location = point;
            this.TableLayoutPanel1.Name = "TableLayoutPanel1";
            this.TableLayoutPanel1.RowCount = 1;
            this.TableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 50f));
            Size size = new Size(0x92, 0x1d);
            this.TableLayoutPanel1.Size = size;
            this.TableLayoutPanel1.TabIndex = 2;
            this.OK_Button.Anchor = AnchorStyles.None;
            point = new Point(3, 3);
            this.OK_Button.Location = point;
            this.OK_Button.Name = "OK_Button";
            size = new Size(0x43, 0x17);
            this.OK_Button.Size = size;
            this.OK_Button.TabIndex = 0;
            this.OK_Button.Text = "OK";
            this.Cancel_Button.Anchor = AnchorStyles.None;
            this.Cancel_Button.DialogResult = DialogResult.Cancel;
            point = new Point(0x4c, 3);
            this.Cancel_Button.Location = point;
            this.Cancel_Button.Name = "Cancel_Button";
            size = new Size(0x43, 0x17);
            this.Cancel_Button.Size = size;
            this.Cancel_Button.TabIndex = 1;
            this.Cancel_Button.Text = "Cancel";
            this.lvwOptions.CheckBoxes = true;
            this.lvwOptions.Columns.AddRange(new ColumnHeader[] { this.ColumnHeader1, this.ColumnHeader2, this.ColumnHeader3 });
            this.lvwOptions.HeaderStyle = ColumnHeaderStyle.Nonclickable;
            point = new Point(12, 12);
            this.lvwOptions.Location = point;
            this.lvwOptions.MultiSelect = false;
            this.lvwOptions.Name = "lvwOptions";
            this.lvwOptions.ShowGroups = false;
            size = new Size(0x1ff, 0x100);
            this.lvwOptions.Size = size;
            this.lvwOptions.TabIndex = 0;
            this.lvwOptions.UseCompatibleStateImageBehavior = false;
            this.lvwOptions.View = View.Details;
            this.ColumnHeader1.Text = "Name";
            this.ColumnHeader1.Width = 0xad;
            this.ColumnHeader2.Text = "Description";
            this.ColumnHeader2.Width = 0xd0;
            this.ColumnHeader3.Text = "Format";
            this.ColumnHeader3.Width = 0x7e;
            this.CustomTextLinkLabel.AutoSize = true;
            point = new Point(12, 0x115);
            this.CustomTextLinkLabel.Location = point;
            this.CustomTextLinkLabel.Name = "CustomTextLinkLabel";
            size = new Size(0xc9, 13);
            this.CustomTextLinkLabel.Size = size;
            this.CustomTextLinkLabel.TabIndex = 1;
            this.CustomTextLinkLabel.TabStop = true;
            this.CustomTextLinkLabel.Text = "Insert custom/static text (like a dash, etc)";
            this.CustomTextLinkLabel.Visible = false;
            this.AcceptButton = this.OK_Button;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.CancelButton = this.Cancel_Button;
            size = new Size(0x217, 0x13b);
            this.ClientSize = size;
            this.Controls.Add(this.CustomTextLinkLabel);
            this.Controls.Add(this.lvwOptions);
            this.Controls.Add(this.TableLayoutPanel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "SelectPathOptionDialog";
            this.ShowInTaskbar = false;
            this.StartPosition = FormStartPosition.CenterParent;
            this.Text = "Add...";
            this.TableLayoutPanel1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        private void OK_Button_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        public DialogResult ShowDialog(IWin32Window owner, ShowOptions showAs, List<NameOption> BaseOptions, List<NameOption> SelectedOptions)
        {
            IEnumerator enumerator;
            this.lvwOptions.Items.Clear();
            foreach (NameOption option in BaseOptions)
            {
                ListViewItem item = new ListViewItem();
                item.Text = option.Name;
                item.Tag = option;
                item.SubItems.Add(option.Description);
                item.SubItems.Add(option.FormatString);
                this.lvwOptions.Items.Add(item);
            }
            if (showAs == ShowOptions.PostName)
            {
                this.Text = "Select Option(s) to Include in the File Name";
                this.CustomTextLinkLabel.Visible = true;
            }
            else
            {
                this.Text = "Select Option(s) to Include in the Folder Name";
                this.CustomTextLinkLabel.Visible = false;
            }
            if (this.ShowDialog(owner) != DialogResult.OK)
            {
                DialogResult result;
                return result;
            }
            try
            {
                enumerator = this.lvwOptions.Items.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    ListViewItem current = (ListViewItem) enumerator.Current;
                    if (current.Checked)
                    {
                        SelectedOptions.Add((NameOption) current.Tag);
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            return DialogResult.OK;
        }

        internal virtual Button Cancel_Button
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Cancel_Button;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.Cancel_Button_Click);
                if (this._Cancel_Button != null)
                {
                    this._Cancel_Button.Click -= handler;
                }
                this._Cancel_Button = value;
                if (this._Cancel_Button != null)
                {
                    this._Cancel_Button.Click += handler;
                }
            }
        }

        internal virtual ColumnHeader ColumnHeader1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ColumnHeader1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ColumnHeader1 = value;
            }
        }

        internal virtual ColumnHeader ColumnHeader2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ColumnHeader2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ColumnHeader2 = value;
            }
        }

        internal virtual ColumnHeader ColumnHeader3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ColumnHeader3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ColumnHeader3 = value;
            }
        }

        internal virtual LinkLabel CustomTextLinkLabel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CustomTextLinkLabel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                LinkLabelLinkClickedEventHandler handler = new LinkLabelLinkClickedEventHandler(this.CustomTextLinkLabel_LinkClicked);
                if (this._CustomTextLinkLabel != null)
                {
                    this._CustomTextLinkLabel.LinkClicked -= handler;
                }
                this._CustomTextLinkLabel = value;
                if (this._CustomTextLinkLabel != null)
                {
                    this._CustomTextLinkLabel.LinkClicked += handler;
                }
            }
        }

        internal virtual ListView lvwOptions
        {
            [DebuggerNonUserCode]
            get
            {
                return this._lvwOptions;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._lvwOptions = value;
            }
        }

        internal virtual Button OK_Button
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OK_Button;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.OK_Button_Click);
                if (this._OK_Button != null)
                {
                    this._OK_Button.Click -= handler;
                }
                this._OK_Button = value;
                if (this._OK_Button != null)
                {
                    this._OK_Button.Click += handler;
                }
            }
        }

        internal virtual TableLayoutPanel TableLayoutPanel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TableLayoutPanel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TableLayoutPanel1 = value;
            }
        }

        public enum ShowOptions
        {
            FolderName,
            PostName
        }
    }
}

